home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 December / PCWDEC06.iso / Software / Trial / Paint Shop Pro XI / Data1.cab / mimebase.py.0160FC08_F3D9_4869_9D41_C611C16F42D5 < prev    next >
Encoding:
Text File  |  2005-06-08  |  794 b   |  25 lines

  1. # Copyright (C) 2001-2004 Python Software Foundation
  2. # Author: Barry Warsaw
  3. # Contact: email-sig@python.org
  4.  
  5. """Base class for MIME specializations."""
  6.  
  7. from email import Message
  8.  
  9.  
  10.  
  11. class MIMEBase(Message.Message):
  12.     """Base class for MIME specializations."""
  13.  
  14.     def __init__(self, _maintype, _subtype, **_params):
  15.         """This constructor adds a Content-Type: and a MIME-Version: header.
  16.  
  17.         The Content-Type: header is taken from the _maintype and _subtype
  18.         arguments.  Additional parameters for this header are taken from the
  19.         keyword arguments.
  20.         """
  21.         Message.Message.__init__(self)
  22.         ctype = '%s/%s' % (_maintype, _subtype)
  23.         self.add_header('Content-Type', ctype, **_params)
  24.         self['MIME-Version'] = '1.0'
  25.